package com.example.springboot2.oa.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot2.oa.entity.TStudent;
import com.example.springboot2.oa.mapper.TStudentMapper;
import com.example.springboot2.oa.service.ITStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author llfy
 * @since 2018-11-23
 */
@Service
public class TStudentServiceImpl extends ServiceImpl<TStudentMapper, TStudent> implements ITStudentService {

    @Autowired
    private TStudentMapper studentMapper;

    @Override
    public Boolean getStudentByName(TStudent student) {
        TStudent tStudent = studentMapper.getStudentByStudno(student);
        if (tStudent != null ){
            return true;
        }else{
            return false;
        }
    }

    @Override
    public TStudent getStudent(TStudent student) {
        return studentMapper.getUser(student);
    }

    @Override
    public Boolean getStudentByNameAndId(TStudent student) {
        TStudent tStudent = studentMapper.getUserByNameAndId(student);
        if (tStudent != null ){
            return false;
        }else{
            return true;
        }
    }

    @Override
    public List<TStudent> listStudent(String name) {
        return studentMapper.listStudent(name);
    }
}
